﻿using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;

namespace XiphMediaEncoder
{
   public partial class AboutForm : Form
   {
      public AboutForm()
      {
         InitializeComponent();

         txtVersion.Text = String.Format(txtVersion.Text, Assembly.GetExecutingAssembly().GetName().Version);
         txtFramework.Text = String.Format(txtFramework.Text, Environment.Version);
         txtWindows.Text = Environment.OSVersion.ToString();

         lnkLuminescence.LinkClicked += (s, e) => ShellExecute("http://www.luminescence-software.org");
      }

      private static void ShellExecute(string url)
      {
         try
         {
            Process.Start(url);
         }
         catch (Win32Exception ex)
         {
            MessageBox.Show(ex.Message, "Xiph Media Encoder", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
      }
   }
}